from django.conf.urls.defaults import *
from wjContact import settings
## urlpattern should be something like:
## (regular expression, Python callback function [, optional dictionary])
##urlpatterns = patterns('',
##    # Example:
##    # (r'^wjContact/', include('wjContact.foo.urls')),
##
##    # Uncomment this for admin:
##     (r'^admin/', include('django.contrib.admin.urls')),
##)

urlpatterns = patterns('',
    (r'^contacts/$', 'wjContact.contacts.views.indexContacts'),
    (r'^contacts/(?P<contact_id>\d+)/$', 'wjContact.contacts.views.detailsContacts'),
#    (r'^polls/(?P<poll_id>\d+)/results/$', 'mysite.polls.views.results'),
    (r'^contacts/add/$', 'wjContact.contacts.views.addContacts'),
    (r'^contacts/search/$', 'wjContact.contacts.views.searchContacts'),
    (r'^contacts/edit/$', 'wjContact.contacts.views.editContacts'),

    # Uncomment this for admin:
    (r'^admin/', include('django.contrib.admin.urls')),
    ## Serving static files such as css and images and javascript:
    ## The following from http://django-tracker.googlecode.com/svn/trunk/urls.py
    ## See also discussion about how to get the django development server to
    ## serve static files (such as css and images) at:
    ## http://www.djangoproject.com/documentation/static_files/
    # Note that the following is only recommnded for use during development.
    # When ready to deploy,remove this and make your webserver do it!
    (r'^sitemedia/(?P<path>.*)$', 'django.views.static.serve', {
        'document_root': settings.MEDIA_ROOT[:-1]
    }),
    ## Next is for logins - just using the django-supplied admin one at the 
    ## moment - see ie /django-docco/authentication on the django website.
    #(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'contacts/login.html'}),
    (r'^accounts/login/$', 'django.contrib.auth.views.login'),
    #(r'^contacts/add/login/$', 'django.contrib.auth.views.login'),
    ## And now logouts (copied from django.contrib.admin.urls)
    #(r'^accounts/logout/$', 'wjContact.contacts.views.logout_view'),
    #('^contacts/add/logout/$', 'wjContact.contacts.views.logout',  {'template_name': 'registration/logged_out.html'}),
    ('^contacts/add/logout/$', 'wjContact.contacts.views.logout',  {'template_name': 'logged_out.html'}),
)

#if settings.DEBUG:
#    urlpatterns += patterns('',
#        (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
#    )